package com.libre.auth.controller;

import com.libre.common.base.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @description   数据权限API拦截字段
* @author        庞留杰
* @date          2022/02/16 09:33
* @version       V1.0
**/
@Slf4j
@RequestMapping("/permissionApiField")
@RestController
public class PermissionApiFieldController  extends BaseController {

//    @Autowired
//    private PermissionApiFieldService service;
//    @ApiOperation(value = "查询带分页列表", notes = "查询带分页列表")
//    @ApiImplicitParams({
//        @ApiImplicitParam(name = "page_number", value = "第几页", dataType = "String", required = false, paramType = "query"),
//        @ApiImplicitParam(name = "page_size", value = "每页数量", dataType = "String", required = false, paramType = "query"),
//        @ApiImplicitParam(name = "sort_field", value = "排序字段", dataType = "String", required = false, paramType = "query"),
//        @ApiImplicitParam(name = "order_type", value = "排序方式asc/desc", dataType = "String", required = false, paramType = "query")
//    })
//    @ApiOperationSupport(ignoreParameters = {
//        "id", "api_id", "created_by", "created_time", "updated_by", "updated_time", "interception_field", "type", "is_delete", "note"
//    })
//    @GetMapping("/findPage")
//    public Result<IPage<PermissionApiField>> findPage(@ModelAttribute PageVo pageVo,@ModelAttribute PermissionApiField permissionApiField) {
//        IPage<PermissionApiField> page = service.findPage(PageUtil.initMpPage(pageVo),permissionApiField);
//        return new ResultUtil<IPage<PermissionApiField>>().setData(page);
//    }
//
//    @ApiOperation(value = "查询不带分页列表", notes = "查询不带分页列表")
//    @ApiOperationSupport(ignoreParameters = {
//        "id", "api_id", "created_by", "created_time", "updated_by", "updated_time", "interception_field", "type", "is_delete", "note"
//    })
//    @GetMapping("/findList")
//    public Result<List<PermissionApiField>> findList(@ModelAttribute PermissionApiField permissionApiField) {
//        List<PermissionApiField> list = service.findList(permissionApiField);
//        return new ResultUtil<List<PermissionApiField>>().setData(list);
//    }
//
//    @ApiOperation(value = "通过ID查询", notes = "通过ID查询")
//    @ApiImplicitParams({
//        @ApiImplicitParam(name = "id", value = "ID", dataType = "String", required = true, paramType = "query")
//    })
//    @GetMapping("/findById")
//    public Result<PermissionApiField> findById(String id) {
//        PermissionApiField permissionApiField = service.findById(id);
//        return new ResultUtil<PermissionApiField>().setData(permissionApiField);
//    }
//
//    @ApiOperation(value = "添加", notes = "添加")
//    @ApiOperationSupport(ignoreParameters = {
//        "id", "created_by", "created_time", "updated_by", "updated_time", "is_delete"
//    })
//    @PostMapping("/save")
//    public Result save(@RequestBody PermissionApiField permissionApiField) {
//        boolean boo = service.add(permissionApiField);
//        if(boo){
//            return new ResultUtil().setSuccessMsg(ResultEnums.OK.getReasonPhraseCN());
//        }else {
//            return new ResultUtil().setErrorMsg(ResultEnums.FAIL.getReasonPhraseCN());
//        }
//    }
//
//    @ApiOperation(value = "修改", notes = "修改")
//    @ApiOperationSupport(ignoreParameters = {
//        "created_by", "created_time", "updated_by", "updated_time", "is_delete"
//    })
//    @PostMapping("/update")
//    public Result update(@RequestBody PermissionApiField permissionApiField) {
//        boolean boo = service.update(permissionApiField);
//        if(boo){
//            return new ResultUtil().setSuccessMsg(ResultEnums.OK.getReasonPhraseCN());
//        }else {
//            return new ResultUtil().setErrorMsg(ResultEnums.FAIL.getReasonPhraseCN());
//        }
//    }
//
//    @ApiOperation(value = "删除", notes = "删除【逻辑删除】")
//    @PostMapping("/delete/{id}")
//    public Result delete(@PathVariable String id) {
//        boolean boo = service.delete(id);
//        if(boo){
//            return new ResultUtil().setSuccessMsg(ResultEnums.OK.getReasonPhraseCN());
//        }else {
//            return new ResultUtil().setErrorMsg(ResultEnums.FAIL.getReasonPhraseCN());
//        }
//    }

}
